//
//  ViewController.m
//  Reader
//
//  Created by 钟纪旺 on 16/12/7.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import "ViewController.h"
#import "YBPopupMenu.h"
#define TITLES @[@"充值", @"阅读历史", @"常见问题",@"联系客服",@"设置"]
#define ICONS  @[@"motify",@"delete",@"saoyisao",@"pay"]
@interface ViewController ()<YBPopupMenuDelegate>

@end

@implementation ViewController
- (IBAction)onD:(id)sender {
     [YBPopupMenu showRelyOnView:sender titles:TITLES icons:ICONS menuWidth:120 delegate:self];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

//- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
//{
//    UITouch *t = touches.anyObject;
//    CGPoint p = [t locationInView: self.view];
//    
//    YBPopupMenu *popupMenu = [[YBPopupMenu alloc] initWithTitles:TITLES icons:nil menuWidth:110 delegate:nil];
//    popupMenu.dismissOnSelected = NO;
//    popupMenu.isShowShadow = YES;
//    popupMenu.delegate = self;
//    popupMenu.offset = 10;
//    popupMenu.type = YBPopupMenuTypeDark;
//    [popupMenu showAtPoint:p];
//}
#pragma mark - YBPopupMenuDelegate
- (void)ybPopupMenuDidSelectedAtIndex:(NSInteger)index ybPopupMenu:(YBPopupMenu *)ybPopupMenu
{
    NSLog(@"点击了 %@ 选项",TITLES[index]);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
